home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / THINKC / 3_0 / CUTILSLI / UTILITYL / CLRBIT.C < prev    next >
Text File  |  1987-11-10  |  1KB  |  61 lines

  1.     /****************************************
  2.     *    File:        ClrBit.c
  3.     *    Purpose:    To Clear a given bit 
  4.     *                in a variable.
  5.     *    Authors:    Robert E. Neville
  6.     *    Date:        11/10/87 
  7.     *    Procedures:    ClrBit().
  8.     *    Version:    1.0a
  9.     *    Copyright:    Hummingbird Graphics
  10.     *****************************************/
  11.     
  12.     /*    
  13.     Note:
  14.         The defines below are the bit locations.
  15.         Notice that they are reversed. It would
  16.         be better to use these instead.  If you
  17.         wanted to use a char or a long for your
  18.         variable the largest BIT (ie. BIT8 or
  19.         BIT32) would be 0x0 and you count larger
  20.         as you go down to BIT1 (0x8, or 0x1F)
  21.         Get it?
  22.     */
  23.     
  24.     /*    Paste these into your header file
  25.     
  26.         #define    BIT1    0xF
  27.         #define    BIT2    0xE
  28.         #define    BIT3    0xD
  29.         #define    BIT4    0xC
  30.         #define    BIT5    0xB
  31.         #define    BIT6    0xA
  32.         #define    BIT7    0x9
  33.         #define    BIT8    0x8
  34.         #define    BIT9    0x7
  35.         #define    BIT10    0x6
  36.         #define    BIT11    0x5
  37.         #define    BIT12    0x4
  38.         #define    BIT13    0x3
  39.         #define    BIT14    0x2
  40.         #define    BIT15    0x1
  41.         #define    BIT16    0x0
  42.     
  43.     */
  44.     
  45.     /****************************************
  46.     *    File:        ClrBit(ptr,bitNum)
  47.     *    Purpose:    To Clear a given bit 
  48.     *                in a variable.
  49.     *    Passed:        char *    -    ptr to var
  50.     *                short    -    bitNum to clr
  51.     *    Returned:    void
  52.     *****************************************/
  53.     
  54.     void ClrBit(ptr,bitNum)
  55.     char *     ptr;
  56.     short    bitNum;
  57.     {
  58.         BitClr(ptr,bitNum);
  59.     }
  60.     
  61.     /**********     End of File     **********/